package cn.findviewbydream.utils;


import cn.findviewbydream.dto.Result;

/**********************************
 * 工程：cn.findviewbydream.utils
 * 作者：白雨濃 evil
 * 时间：17-4-17 下午3:47
 * 邮箱：evilbai@foxmail.com
 * 内容：Result工具类
 **********************************/
public class ResultUtil
{
    public static Result<Object> success(Object obj)
    {
        Result<Object> result = new Result<>();
        result.setCode(1);
        result.setMsg("成功");
        result.setData(obj);
        return result;
    }

    public static Result success()
    {
        return success(null);
    }

    public static Result error(Integer code, String msg)
    {
        Result result = new Result();
        result.setCode(code);
        result.setMsg(msg);
        return result;
    }
}
